/**
 * Desenvolvido pela Fábrica de Software do CESUPA.
 * Todos os direitos reservados.
 */
package br.cesupa.fabsoft.nomedoprojeto.system.application.facades.appmessages;

import br.cesupa.fabsoft.nomedoprojeto.system.application.beans.ApplicationStatusBean;
import java.text.MessageFormat;

/**
 *
 * @author Breno Leite
 */
public class ApplicationStatusParameterContext {

    /**
     * Uses a set of parameters to construct the message.
     *
     * @param parameters a set of parameters. May be any kind of object, most
     * commonly primitives or basic objects such {@link String} and {@link Date}.
     */
    public void withParameters(final Object... parameters) {
        ApplicationStatusBean.getCurrentInstance().getCurrentMessage().setText(
                MessageFormat.format(
                ApplicationStatusBean.getCurrentInstance().getCurrentMessage().getText(),
                parameters));
        ApplicationStatusBean.getCurrentInstance().getCurrentMessage().setDetails(
                MessageFormat.format(
                ApplicationStatusBean.getCurrentInstance().getCurrentMessage().getDetails(),
                parameters));
        ApplicationStatusBean.getCurrentInstance().getCurrentMessage().setSolution(
                MessageFormat.format(
                ApplicationStatusBean.getCurrentInstance().getCurrentMessage().getSolution(),
                parameters));
    }
}
